<template>
  <div class="drone">
    <h3>无人机</h3>
    <Radar />
    <div class="plane">
      <img src="../assets/icons/plane.png" alt="Plane" />
      <img src="../assets/icons/missile.png" alt="Missile" class="missile" />
    </div>
  </div>
</template>

<script>
import Radar from './RadarAgent.vue'
export default {
  components: {
    Radar
  }
}
</script>

<style scoped>
.drone {
  position: relative;
  width: 100%;
  height: 100vh;
  background-color: #000;
  overflow: hidden;
}

.drone h3 {
  margin-top: 0;
}

.plane {
  position: absolute;
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
}

img {
  display: block;
}

.plane img.missile {
  width: 50px;
  height: auto;
  position: absolute;
  bottom: 80%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: missile-fly 3s ease-in-out infinite;
}

@keyframes missile-fly {
  0% {
    opacity: 0;
    bottom: 80%;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    bottom: 0%;
  }
}

@keyframes plane-fly {
  0% {
    left: 50%;
    bottom: 10%;
  }

  50% {
    left: 40%;
    bottom: 5%;
  }

  100% {
    left: 50%;
    bottom: 10%;
  }
}
</style>
